package com.example.demo.mapper;

import com.example.demo.model.Articleinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * user:likai
 * Date:2023-02-14
 * Time:11:03
 */
@Mapper
public interface ArticleMapper {
    //查询所有文章
    public List<Articleinfo> getMyList(@Param("uid") Integer uid);
    //查询一篇文章
    public Articleinfo getDetail(@Param("id") Integer id);
    //修改文章
    public int update(@Param("id") int id,
                      @Param("uid") int uid,
                      @Param("title") String title,
                      @Param("content") String content);
    public List<Articleinfo> getList(@Param("psize") Integer psize,@Param("offset") Integer offset);
    public int getTotalCount();
    public Integer add(@Param("title") String title,
                       @Param("content") String content,
                       @Param("uid") int uid);
    //通过文章id得到userid
    public Integer selectUid(@Param("id") Integer id);
    public Integer delete(@Param("id") Integer id);

}
